<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:p="http://primefaces.org/ui"
                 xmlns:x="http://xpert.com/faces"
                 xmlns:xc="http://java.sun.com/jsf/composite/xpert/components">
    <h3>Source</h3>
    <p:tabView>
        <p:tab title="createPerson.xhtml">
            <h4>Create (createPerson.xhtml)</h4>
            <pre name="code" class="xml">
                &lt;ui:composition  xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
                                xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
                                xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
                                xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
                                xmlns:p=&quot;http://primefaces.org/ui&quot;
                                xmlns:x=&quot;http://xpert.com/faces&quot;
                                xmlns:xc=&quot;http://java.sun.com/jsf/composite/xpert/components&quot;
                                template=&quot;/template/mainTemplate.xhtml&quot;&gt;

                    &lt;ui:param name=&quot;title&quot; value=&quot;#{msg['person.create']}&quot; /&gt;
                    &lt;ui:define name=&quot;body&quot;&gt;
                        &lt;ui:include src=&quot;menuPerson.xhtml&quot; /&gt;
                        &lt;ui:include src=&quot;formCreatePerson.xhtml&quot; /&gt;
                    &lt;/ui:define&gt;
                &lt;/ui:composition&gt;
            </pre>
            <h4>Form (formCreatePerson.xhtml)</h4>
            <pre name="code" class="xml">
            &lt;ui:composition  xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
                                xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
                                xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
                                xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
                                xmlns:p=&quot;http://primefaces.org/ui&quot;
                                xmlns:x=&quot;http://xpert.com/faces&quot;
                                xmlns:xc=&quot;http://java.sun.com/jsf/composite/xpert/components&quot;&gt;
                &lt;h:form&gt;
                    &lt;xc:modalMessages/&gt;
                    &lt;h:panelGrid columns=&quot;2&quot;&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.code']}:&quot; /&gt;
                        &lt;p:inputText value=&quot;\#{personMB.entity.code}&quot; /&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.name']}:&quot; /&gt;
                        &lt;p:inputText value=&quot;\#{personMB.entity.name}&quot; maxlength=&quot;255&quot;  /&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.email']}:&quot; /&gt;
                        &lt;p:inputText value=&quot;\#{personMB.entity.email}&quot; maxlength=&quot;255&quot;  /&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.salary']}:&quot; /&gt;
                        &lt;xc:inputNumber value=&quot;\#{personMB.entity.salary}&quot; /&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.cpf']}:&quot; /&gt;
                        &lt;p:inputText value=&quot;\#{personMB.entity.cpf}&quot; maxlength=&quot;255&quot;  /&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.birthday']}:&quot; /&gt;
                        &lt;p:calendar value=&quot;\#{personMB.entity.birthday}&quot; /&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.rg']}:&quot; /&gt;
                        &lt;p:inputText value=&quot;\#{personMB.entity.rg}&quot; maxlength=&quot;10&quot;  /&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.status']}:&quot; /&gt;
                        &lt;h:selectOneMenu value=&quot;\#{personMB.entity.status}&quot;&gt;
                            &lt;f:selectItem itemLabel=&quot;#{xmsg['select']}&quot; /&gt;
                            &lt;f:selectItems value=&quot;\#{findAllBean.get(classMB.status)}&quot; var=&quot;status&quot; itemLabel=&quot;\#{status}&quot; /&gt;
                        &lt;/h:selectOneMenu&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.group']}:&quot; /&gt;
                        &lt;h:selectOneMenu value=&quot;\#{personMB.entity.group}&quot; converter=&quot;entityConverter&quot; &gt;
                            &lt;x:initializer/&gt;
                            &lt;f:selectItem itemLabel=&quot;#{xmsg['select']}&quot; /&gt;
                            &lt;f:selectItems value=&quot;\#{findAllBean.get(classMB.group)}&quot; var=&quot;group&quot; itemLabel=&quot;\#{group}&quot; /&gt;
                        &lt;/h:selectOneMenu&gt;

                        &lt;h:outputLabel value=&quot;* #{msg['person.group2']}:&quot; /&gt;
                        &lt;h:selectOneMenu value=&quot;\#{personMB.entity.group2}&quot; converter=&quot;entityConverter&quot; &gt;
                            &lt;x:initializer/&gt;
                            &lt;f:selectItem itemLabel=&quot;#{xmsg['select']}&quot; /&gt;
                            &lt;f:selectItems value=&quot;\#{findAllBean.get(classMB.group)}&quot; var=&quot;group&quot; itemLabel=&quot;\#{group}&quot; /&gt;
                        &lt;/h:selectOneMenu&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.permissions']}:&quot; /&gt;
                        &lt;h:selectManyCheckbox value=&quot;\#{personMB.entity.permissions}&quot; converter=&quot;entityConverter&quot; &gt;
                            &lt;x:initializer/&gt;
                            &lt;f:selectItems value=&quot;\#{findAllBean.get(classMB.permission)}&quot; var=&quot;permission&quot; itemLabel=&quot;\#{permission}&quot; /&gt;
                        &lt;/h:selectManyCheckbox&gt;
                    &lt;/h:panelGrid&gt;
                    &lt;p:separator/&gt;
                    &lt;h:outputText value=&quot;#{xmsg['requiredFieldsForm']}&quot;/&gt;
                    &lt;div style=&quot;text-align: center;&quot;&gt;
                        &lt;p:commandButton process=&quot;@form&quot; update=&quot;@form&quot; action=&quot;\#{personMB.save}&quot; value=&quot;#{msg['save']}&quot; /&gt;
                        &lt;xc:audit for=&quot;\#{personMB.entity}&quot;/&gt;
                    &lt;/div&gt;
                &lt;/h:form&gt;
            &lt;/ui:composition&gt;
                                                   
            </pre>
        </p:tab>
        <p:tab title="listPerson.xhtml">
            <h4>List (listPerson.xhtml)</h4>
            <pre name="code" class="xml">
            &lt;ui:composition  xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
                                xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
                                xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
                                xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
                                xmlns:p=&quot;http://primefaces.org/ui&quot;
                                template=&quot;/template/mainTemplate.xhtml&quot;
                                xmlns:x=&quot;http://xpert.com/faces&quot;
                                xmlns:xc=&quot;http://java.sun.com/jsf/composite/xpert/components&quot;&gt;
                &lt;ui:param name=&quot;title&quot; value=&quot;#{msg['person.list']}&quot; /&gt;
                &lt;ui:define name=&quot;body&quot;&gt;
                    &lt;ui:include src=&quot;menuPerson.xhtml&quot; /&gt;
                    &lt;h:form id=&quot;formListPerson&quot;&gt;
                        &lt;xc:modalMessages/&gt;
                        &lt;p:dataTable paginator=&quot;true&quot; rows=&quot;10&quot; rowsPerPageTemplate=&quot;10,20,30&quot;
                                var=&quot;person&quot; value=&quot;\#{personMB.dataModel}&quot;&gt;
                            &lt;p:column headerText=&quot;#{msg['person.code']}&quot; sortBy=&quot;\#{person.code}&quot;
                                    filterBy=&quot;\#{person.code}&quot;&gt;
                                &lt;h:outputText value=&quot;\#{person.code}&quot;/&gt;
                            &lt;/p:column&gt;
                            &lt;p:column headerText=&quot;#{msg['person.name']}&quot; sortBy=&quot;\#{person.name}&quot;
                                    filterBy=&quot;\#{person.name}&quot;&gt;
                                &lt;h:outputText value=&quot;#{person.name}&quot;/&gt;
                            &lt;/p:column&gt;
                            &lt;p:column headerText=&quot;#{msg['person.cpf']}&quot; sortBy=&quot;\#{person.cpf}&quot;
                                    filterBy=&quot;\#{person.cpf}&quot;&gt;
                                &lt;h:outputText value=&quot;\#{person.cpf}&quot;/&gt;
                            &lt;/p:column&gt;
                            &lt;p:column headerText=&quot;#{msg['person.status']}&quot; sortBy=&quot;\#{person.status}&quot;
                                    filterBy=&quot;\#{person.status}&quot;
                                    filterOptions=&quot;\#{findAllBean.getSelect(classMB.status)}&quot;&gt;
                                &lt;h:outputText value=&quot;\#{person.status}&quot;/&gt;
                            &lt;/p:column&gt;
                            &lt;p:column headerText=&quot;#{msg['person.group']}&quot; sortBy=&quot;\#{person.group}&quot;&gt;
                                &lt;h:outputText value=&quot;\#{person.group}&quot;&gt;
                                    &lt;x:initializer/&gt;
                                &lt;/h:outputText&gt;
                            &lt;/p:column&gt;
                            &lt;p:column style=&quot;text-align: center;&quot;&gt;
                                &lt;p:commandButton oncomplete=&quot;widgetPersonDetail.show();&quot;  icon=&quot;ui-icon-zoomin&quot; process=&quot;@this&quot; update=&quot;:formDetailPerson&quot; &gt;
                                    &lt;f:setPropertyActionListener value=&quot;\#{person}&quot; target=&quot;\#{personMB.entity}&quot; /&gt;
                                &lt;/p:commandButton&gt;
                                &lt;p:button icon=&quot;ui-icon-pencil&quot; outcome=&quot;createPerson&quot; &gt;
                                    &lt;f:param name=&quot;id&quot; value=&quot;\#{person.id}&quot; /&gt;
                                &lt;/p:button&gt;
                                &lt;p:commandButton icon=&quot;ui-icon-trash&quot; process=&quot;@this&quot; update=&quot;@form&quot; action=&quot;\#{personMB.delete}&quot; &gt;
                                    &lt;f:setPropertyActionListener value=&quot;\#{person.id}&quot; target=&quot;\#{personMB.id}&quot; /&gt;
                                    &lt;x:confirmation /&gt;
                                &lt;/p:commandButton&gt;
                            &lt;/p:column&gt;
                        &lt;/p:dataTable&gt;
                    &lt;/h:form&gt;

                    &lt;p:dialog widgetVar=&quot;widgetPersonDetail&quot; header=&quot;#{msg['person.detail']}&quot; appendToBody=&quot;true&quot; modal=&quot;true&quot; height=&quot;500&quot; width=&quot;800&quot;&gt;
                        &lt;ui:include src=&quot;detailPerson.xhtml&quot; /&gt;
                    &lt;/p:dialog&gt;


                &lt;/ui:define&gt;
            &lt;/ui:composition&gt;
            </pre>
            <h4>Detail (detailPerson.xhtml)</h4>
            <pre name="code" class="xml">
            &lt;ui:composition  xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
                            xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
                            xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
                            xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
                            xmlns:p=&quot;http://primefaces.org/ui&quot;
                            xmlns:x=&quot;http://xpert.com/faces&quot;
                            xmlns:xc=&quot;http://java.sun.com/jsf/composite/xpert/components&quot;&gt;
                &lt;h:form id=&quot;formDetailPerson&quot;&gt;
                    &lt;h:panelGrid columns=&quot;4&quot; styleClass=&quot;xpert-grid-detail&quot;&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.code']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.code}&quot;/&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.name']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.name}&quot;/&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.email']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.email}&quot;/&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.salary']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.salary}&quot;&gt;
                            &lt;f:convertNumber /&gt;
                        &lt;/h:outputText&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.cpf']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.cpf}&quot;/&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.birthday']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.birthday}&quot;&gt;
                            &lt;f:convertDateTime /&gt;
                        &lt;/h:outputText&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.rg']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.rg}&quot;/&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.status']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.status}&quot;/&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.group']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.group}&quot;&gt;
                            &lt;x:initializer/&gt;
                        &lt;/h:outputText&gt;

                        &lt;h:outputLabel value=&quot;#{msg['person.group2']}:&quot; /&gt;
                        &lt;h:outputText value=&quot;\#{personMB.entity.group2}&quot;&gt;
                            &lt;x:initializer/&gt;
                        &lt;/h:outputText&gt;

                    &lt;/h:panelGrid&gt;
                    &lt;p:separator/&gt;
                    &lt;div style=&quot;text-align: center;&quot;&gt;
                        &lt;p:commandButton type=&quot;button&quot; value=&quot;#{xmsg['close']}&quot; onclick=&quot;widgetPersonDetail.hide()&quot; /&gt;
                        &lt;xc:audit for=&quot;\#{personMB.entity}&quot;/&gt;
                    &lt;/div&gt;
                &lt;/h:form&gt;
            &lt;/ui:composition&gt;       
            </pre>
        </p:tab>
        <p:tab title="Person.java">
              <ui:include src="/views/common/java/person.xhtml"/>
        </p:tab>
         <p:tab title="PersonDAO.java">
              <ui:include src="/views/common/java/personDAO.xhtml"/>
        </p:tab>
        <p:tab title="PersonMB.java">
            <pre name="code" class="java">
            package com.xpert.showcase.mb.crud;

            import com.xpert.core.crud.AbstractBaseBean;
            import com.xpert.core.crud.AbstractBusinessObject;
            import com.xpert.showcase.bo.PersonBO;
            import com.xpert.showcase.model.Person;
            import javax.ejb.EJB;
            import javax.faces.bean.ManagedBean;
            import javax.faces.bean.ViewScoped;


            @ManagedBean
            @ViewScoped
            public class PersonMB extends AbstractBaseBean&lt;Person&gt; {

                @EJB
                private PersonBO personBO;

                @Override
                public AbstractBusinessObject getBO() {
                    return personBO;
                }

                @Override
                public String getDataModelOrder() {
                    return &quot;name&quot;;
                }
            }

            </pre>
        </p:tab>
        
        <p:tab title="PersonBO.java">
            <pre name="code" class="java">
            import com.xpert.core.crud.AbstractBusinessObject;
            import com.xpert.core.exception.BusinessException;
            import com.xpert.persistence.dao.BaseDAO;
            import com.xpert.showcase.dao.PersonDAO;
            import com.xpert.core.validation.UniqueField;
            import com.xpert.core.validation.UniqueFields;
            import com.xpert.showcase.model.Person;
            import java.util.ArrayList;
            import java.util.List;
            import javax.ejb.EJB;
            import javax.ejb.Stateless;

            @Stateless
            public class PersonBO extends AbstractBusinessObject&lt;Person&gt; {

                @EJB
                private PersonDAO personDAO;

                @Override
                public BaseDAO getDAO() {
                    return personDAO;
                }

                @Override
                public List&lt;UniqueField&gt; getUniqueFields() {
                    UniqueFields uniqueFields = new UniqueFields();
                    uniqueFields.add(new UniqueField(&quot;cpf&quot;).setMessage(&quot;CPF already exists&quot;));
                    uniqueFields.add(new UniqueField(&quot;email&quot;).setMessage(&quot;Email already exists&quot;));
                    uniqueFields.add(new UniqueField(&quot;rg&quot;).setMessage(&quot;RG already exists&quot;));
                    return uniqueFields;
                }

                @Override
                public boolean isAudit() {
                    return true;
                }

                @Override
                public void validate(Person person) throws BusinessException {
                }
            }
            </pre>
        </p:tab>
    </p:tabView>
</ui:composition>